Conditions | 4 |
Paths | 6 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /** |
||
62 | faulancer.namespace = function(namespace) |
||
63 | { |
||
64 | 'use strict'; |
||
65 | |||
66 | var parts = namespace.split('.'), |
||
67 | parent = faulancer, |
||
68 | i; |
||
69 | |||
70 | // strip redundant leading global |
||
71 | if (parts[0] === "faulancer") { |
||
72 | parts = parts.slice(1); |
||
73 | } |
||
74 | |||
75 | for (i = 0; i < parts.length; i += 1) { |
||
76 | |||
77 | // create a property if it doesn't exist |
||
78 | if (typeof parent[parts[i]] === "undefined") { |
||
79 | parent[parts[i]] = {}; |
||
80 | } |
||
81 | |||
82 | parent = parent[parts[i]]; |
||
83 | |||
84 | } |
||
85 | |||
86 | return parent; |
||
87 | }; |
||
88 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.